package model

import "time"

type Video struct {
	ID             string    `gorm:"primaryKey;column:id" json:"id"`
	ProfileID      string    `gorm:"column:profile_id" json:"profile_id"`
	Title          string    `gorm:"column:title" json:"title"`
	ExtractType    string    `gorm:"column:extract_type" json:"extract_type"`
	ContentType    string    `gorm:"column:content_type" json:"content_type"`
	Duration       string    `gorm:"column:duration" json:"duration"`
	Resolution     string    `gorm:"column:resolution" json:"resolution"`
	DownloadStatus string    `gorm:"column:download_status;default:pending" json:"download_status"`
	PublishTime    string    `gorm:"column:publish_time" json:"publish_time"`
	HasProduct     bool      `gorm:"column:has_product;default:false" json:"has_product"`
	AudioText      string    `gorm:"column:audio_text" json:"audio_text"`
	Keywords       string    `gorm:"column:keywords" json:"keywords"`
	Author         string    `gorm:"column:author" json:"author"`
	AuthorID       string    `gorm:"column:author_id" json:"author_id"`
	AuthorAvatar   string    `gorm:"column:author_avatar" json:"author_avatar"`
	ViewCount      int       `gorm:"column:view_count;default:0" json:"view_count"`
	LikeCount      int       `gorm:"column:like_count;default:0" json:"like_count"`
	CommentCount   int       `gorm:"column:comment_count;default:0" json:"comment_count"`
	ShareCount     int       `gorm:"column:share_count;default:0" json:"share_count"`
	VideoURL       string    `gorm:"column:video_url" json:"video_url"`
	CoverURL       string    `gorm:"column:cover_url" json:"cover_url"`
	Description    string    `gorm:"column:description" json:"description"`
	Tags           string    `gorm:"column:tags" json:"tags"`
	Platform       string    `gorm:"column:platform" json:"platform"`
	CrawledAt      time.Time `gorm:"column:crawled_at;type:datetime" json:"crawled_at"`
	FilePath       string    `gorm:"column:file_path" json:"file_path"`
	FileSize       int64     `gorm:"column:file_size" json:"file_size"`
	CreatedAt      time.Time `gorm:"column:created_at;type:datetime" json:"created_at"`
	UpdatedAt      time.Time `gorm:"column:updated_at;type:datetime" json:"updated_at"`
}

func (Video) TableName() string {
	return "douyin_videos"
}